package com.tools.web.interceptor.auth._common;

import com.tools.common.container.OwnPairs;
import com.tools.common.object.Note;
import com.tools.web.interceptor.auth.GenericAuthUser;
import com.tools.web.interceptor.auth.LoginDeviceType;

import java.util.Map;

/**
 * 用户的登录记录的用户认证包装类
 * 该类的实现只允许用户一个在线记录
 * */
@Note("用户的登录记录的用户认证包装类" +
        "该类的实现只允许用户一个在线记录")
public final class SingleAuthUser extends GenericAuthUser {

    public SingleAuthUser(Object userId, String loginDeviceType, Object user,
                          Map roleKeyMap, Map permissionIds,
                          Iterable routers) {
        super(userId, loginDeviceType, user, roleKeyMap, permissionIds, routers);
    }


    public static SingleAuthUser of(Object userId, String loginDeviceType, Object user,
                                    Map roleKeyMap, Map permissionIds,
                                    Iterable routers) {
        return new SingleAuthUser(userId, loginDeviceType, user, roleKeyMap, permissionIds, routers);
    }


    /* **************************************************************************************
     *
     *          重写的方法
     *
     * **************************************************************************************
     * */

    @Override
    protected String protected_toStringPropertyString() {
        return "";
    }

    @Override
    public SingleAuthUser uuid(String uuid) {
        super.uuid(uuid);
        return this;
    }

    @Override
    public SingleAuthUser userId(Object userId) {
        super.userId(userId);
        return this;
    }

    @Override
    public SingleAuthUser userId(String userId) {
        super.userId(userId);
        return this;
    }

    @Override
    public SingleAuthUser userId(long userId) {
        super.userId(userId);
        return this;
    }

    @Override
    public SingleAuthUser userId(int userId) {
        super.userId(userId);
        return this;
    }

    @Override
    public SingleAuthUser loginDeviceType(String loginDeviceType) {
        super.loginDeviceType(loginDeviceType);
        return this;
    }

    @Override
    public SingleAuthUser loginDeviceType(LoginDeviceType loginDeviceType) {
        super.loginDeviceType(loginDeviceType);
        return this;
    }

    @Override
    public SingleAuthUser loginUserType(String loginUserType) {
        super.loginUserType(loginUserType);
        return this;
    }

    @Override
    public SingleAuthUser user(Object user) {
        super.user(user);
        return this;
    }

    @Override
    public SingleAuthUser userTypeClass(String userTypeClassName) {
        super.userTypeClass(userTypeClassName);
        return this;
    }

    @Override
    public SingleAuthUser userTypeClass(Class<?> userTypeClass) {
        super.userTypeClass(userTypeClass);
        return this;
    }

    @Override
    public SingleAuthUser roleKeyMap(Map roleKeyMap) {
        super.roleKeyMap(roleKeyMap);
        return this;
    }

    @Override
    public SingleAuthUser roleKeyMap(OwnPairs roleKeyPairs) {
        super.roleKeyMap(roleKeyPairs);
        return this;
    }

    @Override
    public SingleAuthUser permKeyMap(Map permKeyMap) {
        super.permKeyMap(permKeyMap);
        return this;
    }

    @Override
    public SingleAuthUser permKeyMap(OwnPairs permKeyPairs) {
        super.permKeyMap(permKeyPairs);
        return this;
    }

    @Override
    public SingleAuthUser routerList(Iterable routerList) {
        super.routerList(routerList);
        return this;
    }

    @Override
    public SingleAuthUser customData(Map<String, Object> customData) {
        super.customData(customData);
        return this;
    }

    @Override
    public SingleAuthUser customData(OwnPairs<String, Object> customData) {
        super.customData(customData);
        return this;
    }

    @Override
    public SingleAuthUser customData(Object javaBean) {
        super.customData(javaBean);
        return this;
    }

    @Override
    public SingleAuthUser customData(String jsonObject) {
        super.customData(jsonObject);
        return this;
    }

    @Override
    public SingleAuthUser putData(String name, Object value) {
        super.putData(name, value);
        return this;
    }

    @Override
    public SingleAuthUser putAllData(Map customData) {
        super.putAllData(customData);
        return this;
    }

    @Override
    public SingleAuthUser putAllData(OwnPairs customData) {
        super.putAllData(customData);
        return this;
    }

    @Override
    public SingleAuthUser putAllData(String jsonObject) {
        super.putAllData(jsonObject);
        return this;
    }

    @Override
    public SingleAuthUser putAllData(Object javaBean) {
        super.putAllData(javaBean);
        return this;
    }

    @Override
    public SingleAuthUser removeData(String name) {
        super.removeData(name);
        return this;
    }

    @Override
    public SingleAuthUser removeAllData(String... names) {
        super.removeAllData(names);
        return this;
    }

    @Override
    public SingleAuthUser removeAllData(Iterable<String> names) {
        super.removeAllData(names);
        return this;
    }

    @Override
    public SingleAuthUser clearData() {
        super.clearData();
        return this;
    }
}
